#include <func.h>

void *pthread_func(void *p)
{
    printf("child ctime1=%s\n",ctime(p));
    sleep(3);
    printf("child ctime2=%s\n",ctime(p));
    pthread_exit(NULL);
}

int main()
{
    pthread_t pthid;
    time(NULL);
    time_t t=time(NULL);
    pthread_create(&pthid,NULL,pthread_func,(void*)&t);
    sleep(1);
    t=time(NULL);
    printf("main ctime=%s\n",ctime(&t));
    pthread_join(pthid,NULL);
    return 0;
}